import request from '../../utils/request';

// 兴趣管理相关 API

// 创建兴趣
export const createInterest = (data: any) => {
    return request({
        url: '/product/api/interest',
        method: 'post',
        data
    });
};

// 更新兴趣
export const updateInterest = (data: any) => {
    return request({
        url: '/product/api/interest',
        method: 'put',
        data
    });
};

// 根据ID获取兴趣详情
export const getInterestById = (id: string) => {
    return request({
        url: `/product/api/interest/${id}`,
        method: 'get'
    });
};

// 删除兴趣
export const deleteInterest = (id: string) => {
    return request({
        url: `/product/api/interest/${id}`,
        method: 'delete'
    });
};

// 批量删除兴趣
export const batchDeleteInterest = (ids: string[]) => {
    return request({
        url: '/product/api/interest/batch',
        method: 'delete',
        data: { ids }
    });
};

// 分页查询兴趣列表
export const getInterestPage = (params: any) => {
    return request({
        url: '/product/api/interest/page',
        method: 'get',
        params
    });
};

// 获取兴趣列表
export const getInterestList = (params?: any) => {
    return request({
        url: '/product/api/interest/list',
        method: 'get',
        params
    });
};

// 获取启用的兴趣列表
export const getEnabledInterests = () => {
    return request({
        url: '/product/api/interest/enabled',
        method: 'get'
    });
};

// 更新兴趣状态
export const updateInterestStatus = (id: string, status: number) => {
    return request({
        url: `/product/api/interest/${id}/status`,
        method: 'put',
        data: { status }
    });
};